"""
ChainMap的使用示例
"""

from collections import ChainMap

if __name__ == '__main__':
    user_dict = {"name": "Kevin", "no": 89757}
    other_user_dict = {"no": 89757, "height": 173}
    # 合并多个字典，效率更高
    new_dict = ChainMap(user_dict, other_user_dict)

    new_dict.maps[0]["name"] = "天使彦"

    for key, value in new_dict.items():
        print(key, value)
